<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible"content="IE=8"><!--以IE8模式渲染-->
	<meta http-equiv="X-UA-Compatible"content="IE=7"><!--以IE7模式渲染-->
	<meta http-equiv="X-UA-Compatible"content="IE=9; IE=8; IE=7; IE=EDGE">
	<title>百朋后台管理系统</title>
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/manage.css" >
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/easyui/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/easyui/themes/icon.css">
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/easyui/demo.css">
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/js/jquery.alert.v1.2/jquery.alert.css"/>
	<script type="text/javascript" src="__PUBLIC__/js/easyuiTab/jquery-1.4.4.min.js"></script>
	<script type="text/javascript" src="__PUBLIC__/js/jquery.alert.v1.2/jquery.alert.js"></script>  
	<script type="text/javascript" src="__PUBLIC__/js/ajax.js"></script>
	<script TYPE="text/javascript" src="__PUBLIC__/js/common.js"></script>
	<script TYPE="text/javascript" src="__PUBLIC__/js/jquery-1.8.0.min.js"></script>
	<script type="text/javascript" src="__PUBLIC__/easyui/jquery.min.js"></script>
	<script type="text/javascript" src="__PUBLIC__/easyui/jquery.easyui.min.js"></script>
	<script type="text/javascript">
		$(function() 
		{
			var json = '{$detail_json}';
			var array = eval('('+json+')');
			$('#invest_table').datagrid({loadFilter:pagerFilter}).datagrid('loadData', array);
		});

		$(function() 
		{
			var json2 = '{$detail_json2}';
			var array2 = eval('('+json2+')');
			$('#invest_table2').datagrid({loadFilter:pagerFilter}).datagrid('loadData', array2);
		});

		function formatAction(value,row,index) 
		{
			var a = '<input type="button" value="明细" class="input" onclick="profitDetail('+row.invest_id+','+row.customer_id+')">';
			return a;
		}

		function profitDetail(invest_id,customer_id) 
		{
			var data = {"invest_id":invest_id,"customer_id":customer_id};
			var url = "../../invest/invest/profit_detail_annex";
			var async = true;
			var type = null;
			var dataType = "html";
			jQuery.ax(url, data, async, type, dataType,
				function(data) 
				{
					$("#profit_list").html(data);
				},
				function(data) 
				{
					jAlert('系统出错！请联系管理员！','错误提示',null);
				}
			);
		}
	</script>
	<style type="text/css">
		.input 
		{
			border: 1px solid #eaeaea;
			background-color: #6d654e;
			color: #fff;
			text-align: center;
			padding: 0px 10px -1px;
			border-radius: 4px;
		}
	</style>
</head>
<body>
	<div class="contentPage">
		<h1>投资信息</h1>
		<table class="list" cellspacing="0" cellpadding="0">
			<tr>
				<td>投资编号</td>
				<td id="investId"><?php echo $data_array[0]['invest_id']; ?></td>
				<td>投资类型</td>
				<td><?php echo $data_array[0]['invest_type_name']; ?></td>
				<td>投资标题</td>
				<td><?php echo $data_array[0]['invest_title']; ?></td>
			</tr>

			<tr>
				<td>总金额</td>
				<td><?php echo $data_array[0]['invest_total_amount']; ?></td>
				<td>有效时间</td>
				<td><?php echo $data_array[0]['active_time']; ?>天</td>
				<td>投资期限</td>
				<td>
					<?php
						if ($data_array[0]['invest_type_id'] == 1) 
						{
							$investTimeLimit = round($data_array[0]['invest_time_limit']/30)." 月";	
						}
						else
						{
							$investTimeLimit = $data_array[0]['invest_time_limit']." 天";
						}
						echo $investTimeLimit;
					?>
				</td>
			</tr>

			<tr>
				<td>投资利率</td>
				<td><?php echo $data_array[0]['invest_rate']; ?></td>
				<td>承兑银行</td>
				<td><?php echo $data_array[0]['accepting_bank']; ?></td>
				<td>备注</td>
				<td><?php echo $data_array[0]['remark']; ?></td>
			</tr>

			<tr>
				<td>还款方式</td>
				<td><?php echo $data_array[0]['repay_name']; ?></td>
				<td>创建时间</td>
				<td><?php echo $data_array[0]['create_time']; ?></td>
				<td></td>
				<td></td>
			</tr>

			<tr>
				<td>参/总投人数</td>
				<td><?php echo $data_array[0]['invest_number']; ?></td>
				<td>已投金额</td>
				<td><?php echo $data_array[0]['invest_money']; ?></td>
				<td>投资状态</td>
				<td><?php echo $data_array[0]['invest_status_name']; ?></td>
			</tr>

			<?php
				if ($data_array[0]['invest_type_id'] == 3) 
				{
					echo "<tr>";
					echo "<td>已投人数</td>";
					echo "<td>" . $data_array[0]['count'] . "</td>";
					if($luck_array['id']) 
					{
						echo "<td>中奖序号</td>";
						echo "<td>" . $luck_array['invest_number'] . "</td>";
					}
					else
					{
						echo "<td>开始抽奖</td>";
						echo "<td><input type='button' value='前往抽奖' onclick=window.location.href='../../invest/invest/invest_luckly?invest_id=".$data_array[0]['invest_id']."'; /></td>";
					}
					echo "<td>新增订单</td>";
					echo "<td><input type='button' value='新增订单' onclick=window.location.href='../../invest/invest/invest_order_add?invest_id=".$data_array[0]['invest_id']."'; /></td>";
					echo "</tr>";
				}
			?>
		</table><br/>
		<HR width="100%" color=black /><br/>

		<!-- <div>
			<h1 style="float: left">投资列表</h1>
		</div> -->
		<div class="invest_table">
			<table id="invest_table" title="投资列表" style="width:100%;height:auto" 
				data-options="
					rownumbers:true,
					singleSelect:true,
					autoRowHeight:false,
					pagination:true,
					pageSize:10
				"
			>
				<thead>
					<tr>
						<th field="invest_id" width="15%" align="center">投资ID</th>
						<th field="cust_name" width="15%" align="center">投资人</th>
						<th field="invest_rate" width="15%" align="center">投资利率</th>
						<th field="invest_money" width="15%" align="center">投资金额</th>
						<th field="invest_time" width="20%" align="center">投资时间</th>
						<th field="action" width="19%" align="center" formatter="formatAction">操作</th>
					</tr>
				</thead>
			</table>
		</div>
		<br/>
		<HR width="100%" color=black /><br/>

		<!-- <div>
			<h1 style="float: left">还款明细</h1>
		</div> -->
		<div id="profit_list"></div>
	</div>
</body>
</html>